# smplayer
# Builds from https://github.com/puppylinux-woof-CE/petbuilds
# File auto generated by ./mk_petbuild.sh. Edit as necessary.

. ../func
. ../build.conf

URL=https://downloads.sourceforge.net/project/smplayer/SMPlayer/17.4.2
PKG=smplayer
VER=17.4.2
COMP=tar.bz2
DESC="QT frontend for MPlayer"
DEPS=+qt,+MPlayer
CAT=Multimedia
DESKTOP=smplayer.desktop
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
# comment these 2 below if you use a custom package() function
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not

ARCH=$(uname -m)
case $ARCH in # set in build.conf
 *64) 	LIBDIR=$LIBCONF64 
		FLAGS=$CF64;;
 arm*)	LIBDIR=$LIBCONFarm
		FLAGS="-O2" ;;
 i686) 	LIBDIR=$LIBCONF32 
		FLAGS=$CF32;;
	*) 	LIBDIR=$LIBCONF32 
		FLAGS="-O2 -march=$ARCH -mtune=$ARCH";;
esac

build_() {
	(
	cd ${PKG}-${VER}
	make PREFIX=/usr || exit
	make PREFIX=/usr DESTDIR=${CWD}/${PKG}-install install
	)
	mkdir -p ${PKG}-install/usr/share/pixmaps/
	cp -af ${PKG}.svg ${PKG}-install/usr/share/pixmaps/
	sed -i -e 's/Icon=.*/Icon=smplayer.svg/' \
			-e 's/ %U//' \
			-e 's/Categories=.*/Categories=Video;/' ${PKG}-install/usr/share/applications/*.desktop
}

# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
build_
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT
